﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Login.ascx.cs" Inherits="Admin_Components_Member_Login" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<style type="text/css">
    body {
        background:#ebf0f3;
    }
    header {
        display:none;
    }
</style>
<script language="Javascript">
    function capLock(e) {
        kc = e.keyCode ? e.keyCode : e.which;
        sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false);
        if (((kc >= 65 && kc <= 90) && !sk) || ((kc >= 97 && kc <= 122) && sk)) {
            $('#ctl00_ContentPlaceHolder1_ctl00_LoginAD_lblFailure').show();
        }
        else {
            $('#ctl00_ContentPlaceHolder1_ctl00_LoginAD_lblFailure').hide();
        }
    }
</script>

<div class="progressbar">
    <asp:UpdateProgress ID="up" runat="server" AssociatedUpdatePanelID="updatePanel">
        <ProgressTemplate>
            <img src="../../../Template/Images/ajax-progress-bar.gif" alt="progressbar" />
        </ProgressTemplate>
    </asp:UpdateProgress>
</div>
    <div id="loginbox" class="loginBox col-md-7">
        <div class="text header">
            <h1>Thông tin đăng nhập</h1>
        </div>
        <div class="clearfix text-center">
            <div class="row">
                <div class="col-md-6 logo-fpt">
                    <img src="../../../Template/Images/logo.png" />
                </div>
                <div class="col-md-6">
                    <div style="padding:5px 0;"> 
                        <div class="row wrapper-center">
                            <asp:textbox ID="txtUserName" runat="Server" CssClass="loginTextbox form-control" placeholder="Tên đăng nhập" />
                        </div>
                        <div class="row wrapper-center">
                            <asp:textbox ID="txtPassword" CssClass="loginTextbox form-control" TextMode="Password" runat="Server"
                                placeholder="Mật khẩu"
                                onkeypress="capLock(event)"/>
                        </div>
                        <div class="row wrapper-center">
                            <telerik:RadCaptcha ID="radCaptchaControl" CssClass="" runat="server" ForeColor="#FFFF66"
                                BorderStyle="None" CaptchaTextBoxLabel="" CaptchaImage-FontFamily="Tahoma" CaptchaImage-TextColor="#3366CC"
                                CaptchaImage-TextChars="Numbers" CaptchaImage-TextLength="4" >
                            </telerik:RadCaptcha>
                        </div>
                        <div class="row wrapper-right">
                            <%--<a href="../../../forgetpassword.aspx">Quên mật khẩu</a>--%>
                            <a data-url="../../../forgetpassword.aspx" data-toggle="modal" data-target="#myModal" style="cursor:pointer;">Quên mật khẩu</a>
                            <span style="width:20px;"></span>
                            <asp:Button ID="btnLogin" runat="server" Text="Ðăng nhập"
                            CssClass="loginBtn" OnClick="btnLogin_Authenticate" OnClientClick="return CheckLogin()"/><br />
                        </div>
                         <div class="row wrapper-center">
                        <span id="lblFailure" runat="server" visible="false" class="left text-left" style="color:red;"></span>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
       
      
        <asp:UpdatePanel ID="updatePanel" runat="server">
    <ContentTemplate>
    </ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
    function ResetMassage(time, lblResultID) {
        setTimeout(
                function () {
                    document.getElementById(lblResultID).innerHTML = "";
                }, time);
    }
    function CheckLogin(button, args) {
        //alert('jkshgja');
        var txtUserName_func = $('#<%= txtUserName.ClientID %>'); 
        var txtPassword_func = $('#<%= txtPassword.ClientID %>');
       // alert(txtUserName_func.val());

        if (txtUserName_func.val() == '') {
            document.getElementById('<%= lblFailure.ClientID %>').innerHTML = 'Vui lòng nhập tên đăng nhập';
            ResetMassage(15000, '<%= lblFailure.ClientID %>');
            // button.set_autoPostBack(false);
            return false;
        }
        else if (txtPassword_func.val() == '') {
            document.getElementById('<%= lblFailure.ClientID %>').innerHTML = 'Vui lòng nhập mật khẩu';
            ResetMassage(15000, '<%= lblFailure.ClientID %>');
            // button.set_autoPostBack(false);
            return false;
        }
        else {
            //button.set_autoPostBack(true);
            return true;
        }
    }
        
       
    
</script>
